package tomasulo.component;

import tomasulo.unit.CPUListener;
import tomasulo.unit.Instr;

public abstract class Component implements CPUListener {

	protected String name = null;
	protected boolean busy = false;
	protected int time = 0;
	protected final int TIME_WAIT = -1;
	protected Instr instr = null;
		
	public int getTime() {
		return time;
	}
	
	public Component(String name) {
		this.name = name;
	}
	
	@Override
	public String toString() {
		return name;
	}
	
	public boolean isBusy() {
		return busy;
	}
	
	@Override
	public abstract void checkCDB(int tick);
	
	@Override
	public abstract boolean issue(Instr instr);
	
	@Override
	public abstract void afterTick(int tick);
	
	@Override
	public abstract void reset();
	
}
